﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="YSKXZLFXB.aspx.cs" Inherits="ZHCX_YSKXZLFXB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>
  <link href="css/zlfx.css" rel="stylesheet" type="text/css" />
  <script src="../js/jquery.js" type="text/javascript"></script>
  <script type="text/javascript">
    jQuery(function ($) {
      $("#xls").empty();
      $("#xls").attr('value', encodeURI($("#xlsTable").html()));
    });
  </script>
</head>
<body link="blue" vlink="purple">
  <form id="form1" runat="server">
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEF2FB">
    <tr>
      <td>
    <asp:HiddenField runat="server" ID="xls" />
        <asp:Label ID="Label1" runat="server" Text="年份" Font-Size="12px"></asp:Label>
        <asp:DropDownList ID="ddlYear" runat="server">
        </asp:DropDownList>
        <asp:Label ID="Label2" runat="server" Text="月份" Font-Size="12px"></asp:Label>
        <asp:DropDownList ID="ddlMonth" runat="server">
          <asp:ListItem Value="01">一月</asp:ListItem>
          <asp:ListItem Value="02">二月</asp:ListItem>
          <asp:ListItem Value="03">三月</asp:ListItem>
          <asp:ListItem Value="04">四月</asp:ListItem>
          <asp:ListItem Value="05">五月</asp:ListItem>
          <asp:ListItem Value="06">六月</asp:ListItem>
          <asp:ListItem Value="07">七月</asp:ListItem>
          <asp:ListItem Value="08">八月</asp:ListItem>
          <asp:ListItem Value="09">九月</asp:ListItem>
          <asp:ListItem Value="10">十月</asp:ListItem>
          <asp:ListItem Value="11">十一月</asp:ListItem>
          <asp:ListItem Value="12">十二月</asp:ListItem>
        </asp:DropDownList>
        <asp:Button ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" />
        <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/ExportXLS.aspx" Font-Size="12px">导出xls</asp:LinkButton>
      </td>
    </tr>
  </table>
  <div>
    <table x:str border="0" cellpadding="0" cellspacing="0" width="891" style='border-collapse: collapse;
      table-layout: fixed; width: 670pt'>
      <col width="194" style='mso-width-source: userset; mso-width-alt: 6208; width: 146pt'>
      <col width="65" style='mso-width-source: userset; mso-width-alt: 2080; width: 49pt'>
      <col width="119" style='mso-width-source: userset; mso-width-alt: 3808; width: 89pt'>
      <col width="117" style='mso-width-source: userset; mso-width-alt: 3744; width: 88pt'>
      <col width="97" style='mso-width-source: userset; mso-width-alt: 3104; width: 73pt'>
      <col width="98" style='mso-width-source: userset; mso-width-alt: 3136; width: 74pt'>
      <col width="92" style='mso-width-source: userset; mso-width-alt: 2944; width: 69pt'>
      <col width="109" style='mso-width-source: userset; mso-width-alt: 3488; width: 82pt'>
      <tr height="60" style='mso-height-source: userset; height: 45.0pt'>
        <td colspan="8" height="60" class="xl84" width="891" style='border-right: .5pt solid black;
          height: 45.0pt; width: 670pt'>
          应收款项账龄分析
        </td>
      </tr>
      <tr height="20" style='mso-height-source: userset; height: 15.0pt'>
        <td rowspan="3" height="66" class="xl87" style='height: 49.5pt'>
          单位
        </td>
        <td rowspan="3" class="xl88" style='border-bottom: .5pt solid black'>
          行次
        </td>
        <td rowspan="3" class="xl87">
          合计金额
        </td>
        <td colspan="5" class="xl89" style='border-right: .5pt solid black; border-left: none'>
          按账龄分析应收款项
        </td>
      </tr>
      <tr height="22" style='mso-height-source: userset; height: 16.5pt'>
        <td height="22" class="xl94" style='height: 16.5pt; border-top: none'>
          6个月以内
        </td>
        <td class="xl95" style='border-top: none'>
          6个月-1年
        </td>
        <td class="xl96" style='border-top: none; border-left: none'>
          1年-2年
        </td>
        <td class="xl96" style='border-top: none; border-left: none'>
          2年-3年
        </td>
        <td class="xl96" style='border-top: none; border-left: none'>
          3年以上
        </td>
      </tr>
      <tr height="24" style='mso-height-source: userset; height: 18.0pt'>
        <td height="24" class="xl98" width="117" style='height: 18.0pt; border-top: none;
          width: 88pt'>
          欠费余额
        </td>
        <td class="xl98" width="97" style='border-top: none; width: 73pt'>
          欠费余额
        </td>
        <td class="xl99" width="98" style='border-top: none; border-left: none; width: 74pt'>
          欠费余额
        </td>
        <td class="xl99" width="92" style='border-top: none; border-left: none; width: 69pt'>
          欠费余额
        </td>
        <td class="xl99" width="109" style='border-top: none; border-left: none; width: 82pt'>
          欠费余额
        </td>
      </tr>
      <tr height="20" style='mso-height-source: userset; height: 15.0pt; background: aqua;'>
        <td height="20" class="xl67" style='height: 15.0pt; border-top: none'>
          总计
        </td>
        <td class="xl67" style='border-top: none; border-left: none' x:num>
          1
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
          <asp:Label ID="lbHJ" runat="server" Text="Label"></asp:Label>
        </td>
        <td class="xl65" style='border-left: none'>
        </td>
        <td class="xl66" style='border-left: none'>
        </td>
        <td class="xl66" style='border-left: none'>
        </td>
        <td class="xl66" style='border-left: none'>
        </td>
        <td class="xl66" style='border-left: none'>
        </td>
      </tr>
      <tr height="18" style='height: 13.5pt; background: aqua;'>
        <td height="18" class="xl65" style='height: 13.5pt; border-top: none'>
          一、外部单位
        </td>
        <td class="xl67" style='border-top: none; border-left: none' x:num>
          2
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
          <%=dsWBDW.Tables[0].Compute("sum(dq)","") %>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
        </td>
      </tr>
      <% for (int i = 0; i < dsWBDW.Tables[0].Rows.Count; i++)
         { %>
      <tr height="18" style='height: 13.5pt'>
        <td height="18" class="xl65" style='height: 13.5pt; border-top: none; word-wrap: break-word;
          word-break: break-all;'>
          <%=dsWBDW.Tables[0].Rows[i]["cx_khbm"].ToString()+"-"+dsWBDW.Tables[0].Rows[i]["khmc"].ToString() %>
        </td>
        <td class="xl67" style='border-top: none; border-left: none' x:num>
          <%=(i+3).ToString()%>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
          <%=dsWBDW.Tables[0].Rows[i]["dq"].ToString()%>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
          <%=dsWBDW.Tables[0].Rows[i]["BN"].ToString() %>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
          <%=dsWBDW.Tables[0].Rows[i]["yN"].ToString() %>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
          <%=dsWBDW.Tables[0].Rows[i]["eN"].ToString() %>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
          <%=dsWBDW.Tables[0].Rows[i]["sN"].ToString() %>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
          <%=dsWBDW.Tables[0].Rows[i]["ESN"].ToString() %>
        </td>
      </tr>
      <%} %>
      <tr height="18" style='height: 13.5pt; background: aqua;'>
        <td height="18" class="xl65" style='height: 13.5pt; border-top: none'>
          二、分公司内部单位
        </td>
        <td class="xl67" style='border-top: none; border-left: none' x:num>
          <%=(dsWBDW.Tables[0].Rows.Count+3).ToString() %>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
          <%=dsNBDW.Tables[0].Compute("sum(dq)", "")%>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
      </tr>
      <%for (int i = 0; i < dsNBDW.Tables[0].Rows.Count; i++)
        {%>
      <tr height="18" style='height: 13.5pt'>
        <td height="18" class="xl65" style='height: 13.5pt; border-top: none; word-wrap: break-word;
          word-break: break-all;'>
          <%=dsNBDW.Tables[0].Rows[i]["cx_khbm"].ToString() + "-" + dsNBDW.Tables[0].Rows[i]["khmc"].ToString()%>
        </td>
        <td class="xl67" style='border-top: none; border-left: none' x:num>
          <%=(i+dsWBDW.Tables[0].Rows.Count+4).ToString() %>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
          <%=dsNBDW.Tables[0].Rows[i]["dq"].ToString()%>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
          <%=dsNBDW.Tables[0].Rows[i]["BN"].ToString()%>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
          <%=dsNBDW.Tables[0].Rows[i]["yN"].ToString()%>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
          <%=dsNBDW.Tables[0].Rows[i]["eN"].ToString()%>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
          <%=dsNBDW.Tables[0].Rows[i]["sN"].ToString()%>
        </td>
        <td class="xl66" style='border-top: none; border-left: none'>
          <%=dsNBDW.Tables[0].Rows[i]["ESN"].ToString()%>
        </td>
      </tr>
      <%} %>
      <tr height="18" style='height: 13.5pt; background: aqua;'>
        <td height="18" class="xl65" style='height: 13.5pt; border-top: none'>
          三、关联交易单位
        </td>
        <td class="xl67" style='border-top: none; border-left: none' x:num>
          <%=(dsWBDW.Tables[0].Rows.Count+dsNBDW.Tables[0].Rows.Count+4).ToString() %>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
          <%=dsJYDW.Tables[0].Compute("sum(dq)", "")%>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
      </tr>
      <%for (int i = 0; i < dsJYDW.Tables[0].Rows.Count; i++)
        {%>
      <tr height="18" style='height: 13.5pt'>
        <td height="18" class="xl65" style='height: 13.5pt; border-top: none; word-wrap: break-word;
          word-break: break-all;'>
          <%=dsJYDW.Tables[0].Rows[i]["cx_khbm"].ToString() + "-" + dsJYDW.Tables[0].Rows[i]["khmc"].ToString()%>
        </td>
        <td class="xl67" style='border-top: none; border-left: none' x:num>
          <%=(i+dsWBDW.Tables[0].Rows.Count+dsNBDW.Tables[0].Rows.Count+5).ToString() %>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
        <td class="xl65" style='border-top: none; border-left: none'>
        </td>
      </tr>
      <%} %>
    </table>
  </div>
  </form>
</body>
</html>
